var CandidateExperience = {
	getExperienceGrid: function() {
		ajax({
			  url: baseURL + "candidate/experience",
			  cache: false,
			  type: "POST",
			  data: $('#ajax_form').serialize(),
			  async: false,
			  dataType: 'html',
			  success: function(data) {
				  $('#gridExperience').html(data);
			  }
			});
	},
	
	getJobHierarchy: function() {
		ajax({
			  url: baseURL + "ajax/get_job_hierarchy",
			  cache: false,
			  type: "POST",
			  async: false,
			  dataType: 'html',
			  success: function(data) {
				  $('#jobHierarchy').html(data);
			  }
			});
	},
	
	getJobCategory: function() {
		ajax({
			  url: baseURL + "ajax/get_job_category",
			  cache: false,
			  type: "POST",
			  async: false,
			  dataType: 'html',
			  success: function(data) {
				  $('#jobCategory').html(data);
			  }
			});
	},
	
	getJobSpecialty: function() {
		if ($('#idcategory').val()) {
			ajax({
				  url: baseURL + "ajax/get_job_specialty",
				  cache: false,
				  type: "POST",
				  async: false,
				  data: 'idcategory=' + $('#idcategory').val(),
				  dataType: 'html',
				  success: function(data) {
					  $('#jobSpecialty').html(data);
				  }
				});
		} else {
			$('#jobSpecialty').html('<div>' + ajax_lang[2] + '</div>');
		}
	},

	editExperience: function(idexperience) {
		$.facebox(function() {
			ajax({
			  url: baseURL + "candidate/experience/edit/" + idexperience,
			  cache: false,
			  type: "POST",
			  async: false,
			  dataType: 'html',
			  success: function(data) { $.facebox(data) }
			});
		});
		
		return false;
	},
	
	processExperience: function() {
		ajax({
		  url: baseURL + "candidate/experience/" + ($('#idexperience').val() ? 'update' : 'insert'),
		  cache: false,
		  type: "POST",
		  data: $('#ajax_form').serialize(),
		  async: false,
		  dataType: 'script'
		});
		
		return false;
	},
	
	deleteExperience: function(idexperience) {
		ajax({
			  url: baseURL + "candidate/experience/delete",
			  cache: false,
			  type: "POST",
			  data: 'id=' + idexperience,
			  async: false,
			  dataType: 'script'
			});
			
			return false;
	}
};